import request from '@/utils/request'

// 生成登录验证码

// 用户登录
export const login = (data) => {
  return request({
    url: '/login',
    method: 'POST',
    notoken: true,
    data
  })
}

export const city = (data) => {
  return request({
    url: '/data/hot_cities',
    method: 'POST',
    data
  })
}

// 生成登录验证码
export function getImage(params) {
  return request({
    url: '/captcha?type=login',
    responseType: 'arraybuffer',
    params,
    notoken: true
  })
}
// 用户登录
// export function login(data) {
//   return request({
//     url: '/login',
//     method: 'POST',
//     notoken: true,
//     data
//   })
// }
// 头像上传
export function uploads(image) {
  return request({
    url: '/uploads',
    method: 'post',
    data: {
      image
    }
  })
}
// 生成注册验证码
export function sendsms(params) {
  return request({
    url: '/captcha?type=sendsms',
    responseType: 'arraybuffer',
    params,
    notoken: true
  })
}
// 注册页面登录
export function register(data) {
  return request({
    url: '/register',
    method: 'post',
    data
  })
}
// 验证码
export function bigsendsms(data) {
  return request({
    url: '/sendsms',
    method: 'post',
    notoken: true,
    data
  })
}

